home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / 422mods.zip / TFC19ADD.422 < prev    next >
Text File  |  1993-03-30  |  3KB  |  92 lines

  1. An Internal CNVTUSER.C MOD.. 
  2. ``Bast`` WWIVNet #1 AT 7319
  3. Wed Mar 24 16:46:21 1993
  4. /**
  5. ┌────────────────────────────────────────────────────────────────────────────┐
  6. │ Mod Name: File Point Giver        Mod Author: Bast                         │
  7. │ Difficulty: ▒▒░░░░░░░░            Date: 03/24/93                           │
  8. │ WWIV Version: 4.22 and above                                               │
  9. │ Files Affected: BBS.C                                                      │
  10. │ Description: Gives Users File Points. For Use With TFC019.MOD, The File    │
  11. │              Point System By The Flying Chicken.                           │
  12. └────────────────────────────────────────────────────────────────────────────┘
  13. **/
  14.  
  15. /** STEP 1: Backup Your Source!!!!!
  16.             I cannot and will not be responsible for anything bad
  17.             happening to your source code because you didn't back
  18.             it up.
  19. **/
  20.  
  21. /** STEP 2: Open BBS.C
  22.             Search For/Modify Following
  23. **/
  24.  
  25. void mainmenu(void)
  26. {
  27.   char *s, s1[81],s2[81],fps[5],ch,ch2;    /** Add fps[5] **/
  28.   int i,done;
  29.   long l;
  30.  
  31.         .
  32.         .
  33.         .
  34.  
  35.     if (strcmp(s,"GFILEEDIT")==0) {
  36.       sysoplog(get_stringx(1,5));
  37.       gfileedit();
  38.     }
  39.     if (strcmp(s,"GIVEFPS")==0) {    /** Add From Here **/
  40.        prt(1,"How many? ");
  41.        input(fps,4);
  42.        if(fps[0]==0) i=-1;
  43.        else i=atoi(fps);
  44.        give_fps(i);
  45.     }                                /** To Here **/
  46.  
  47. /** At The Bottom Of BBS.C, Add The Following Function **/
  48.  
  49. void give_fps(int x)                /** Give All Users FilePoints **/
  50. {
  51.     int i;
  52.     userrec u;
  53.     long l;
  54.  
  55.     for(i=1;i<=number_userrecs();i++)
  56.     {
  57.       read_user(i,&u);
  58.  
  59.       if(x==-1) {
  60.         l = (u.uk * 2) - u.dk;
  61.         if (l>0)
  62.             u.filepoints = l;
  63.         else
  64.             u.filepoints = 0;
  65.       } else
  66.          u.filepoints=(long) x;
  67.       write_user(i,&u);
  68.       close_user();
  69.     }
  70. }
  71.  
  72. Save/Close BBS.C
  73.  
  74. Compile And You're Done!
  75. Typing 1//GIVEFPS 0from Main Menu Will Allow You To Give All Users
  76. A Specified Amount Of FilePoints. Entering A Value Of -1 (negative one)
  77. Will Use The Flying Chicken's Formula For Giving The Users File Points.
  78. I Wrote This Because TFC's CNVTUSER.C Program Didn't Work, And My
  79. External Program To Do The Same Didn't Work. I Hope This Helps You Out.
  80.  
  81. Thanks Go To The Flying Chicken For Writing The File Point System,
  82. And To Wayne Bell For Writing WWIV.
  83.  
  84.  
  85.                                 - Bast
  86.  
  87. 1@7319  WWIVNet
  88. 2@17306 WWIVLink
  89. 2@7309  IceNet
  90.  
  91. <EOF>
  92.